<!doctype html>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0,viewport-fit=cover">
    <title>首页</title>
    <link rel="stylesheet" type="text/css" href="../js/vant/index.css" />
    <link rel="stylesheet" type="text/css" href="../css/index.css" /> 
</head>

<body>
    <div id="index_id">
        <div class="page">
            <template v-if="activeTab==0">
                <iframe src="./activity/activit_entry.html" width="100%" height="100%"></iframe>
                <iframe src="./order/enterprise_list.html" width="100%" height="100%"></iframe>
            </template>
            <template v-else-if="activeTab==1">
                <iframe src="./order/my_order.html" id="order_frame" name="order_frame"></iframe>
            </template>
            <template v-else-if="activeTab==2">
                <iframe src="./order/enterprise_list.html"></iframe>
            </template>
        </div>
        <van-tabbar v-model="activeTab" active-color="#0eab4b">
            <van-tabbar-item>
                <span>首页</span>
                <template #icon="props">
                    <img :src="activeTab==0 ? icon[0].active : icon[0].inactive" />
                </template>
            </van-tabbar-item>
            <van-tabbar-item>
                <span>我的订单</span>
                <template #icon="props">
                    <img :src="activeTab==1 ? icon[1].active : icon[1].inactive" />
                </template>
            </van-tabbar-item>
            <van-tabbar-item>
                <span>取水点</span>
                <template #icon="props">
                    <img :src="activeTab==2 ? icon[2].active : icon[2].inactive" />
                </template>
            </van-tabbar-item>
          </van-tabbar>
    </div>
</body>
<script type="text/javascript" src="../js/jquery/jquery320min.js"></script> 
<script type="text/javascript" src="../js/vant/vuemin.js"></script>
<script type="text/javascript" src="../js/vant/vantmin.js"></script>
<script type="text/javascript">

    var indexVm;
    var openId = '';
    $(function() {
        openId = getParam('openId');
        if (openId != null && openId != undefined && openId != '') {
            window.localStorage.setItem("openId", openId);
        }

        indexVm = new Vue({
            el:'#index_id',
            data:{
                activeTab:0,
                icon: [
                    {
                        active: '../images/icon/index02.png',
                        inactive: '../images/icon/index01.png',
                    },
                    {
                        active: '../images/icon/order02.png',
                        inactive: '../images/icon/order01.png',
                    },
                    {
                        active: '../images/icon/me02.png',
                        inactive: '../images/icon/me01.png',
                    }
                ]
            },
            methods:{
                footerTabClick:function(action){
                    this.activeTab=action;
                }
            }
        });
    });

    function getParam(paramName) {
        paramValue = "", isFound = !1;
        if(this.location.search.indexOf("?") == 0 && this.location.search.indexOf("=") > 1) {
            arrSource = unescape(this.location.search).substring(1, this.location.search.length).split("&"), i = 0;
            while(i < arrSource.length && !isFound) arrSource[i].indexOf("=") > 0 && arrSource[i].split("=")[0].toLowerCase() == paramName.toLowerCase() && (paramValue = arrSource[i].split("=")[1], isFound = !0), i++
        }
        return paramValue == "" && (paramValue = null), paramValue
    }
 </script>   
</html>